﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PushTest
{
  /// <summary>
  /// Interaction logic for MainWindow.xaml
  /// </summary>
  public partial class MainWindow : Window
  {
      public MainWindow()
      {
        InitializeComponent();
      }

      private void BtnSendToastClick(object sender, RoutedEventArgs e)
      {
        var svc = new GFService.GeoFinderClient();
        svc.SendToastToAll(txtToastTitle.Text, txtToastMessage.Text);
      }

      private void BtnSendMessageClick(object sender, RoutedEventArgs e)
      {
          var svc = new GFService.GeoFinderClient();
        svc.SendRawNotificationToAll(txtMessage.Text);

      }

      private void BtnSendTileUpdateClick(object sender, RoutedEventArgs e)
      {
          var svc = new GFService.GeoFinderClient();
        var logoPath = string.Empty;

        switch (cmbImage.SelectedIndex)
        {
          case 0:
            logoPath = "/Icons/logo1.png";
            break;
          case 1:
            logoPath = "/Icons/logo2.png";
            break;
          case 2:
            logoPath = "/Icons/logo3.png";
            break;
        }

        int count;

        if (Int32.TryParse(txtTileCount.Text, out count))
        {
          svc.SendTileUpdateToAll(txtTileTitle.Text, count, logoPath);
        }

      }
    }
  }

